<?php
class AjaxAction extends CommonAction{
    function _initialize() {
        import('@.ORG.Util.Cookie');
        //检查认证识别号
        if (!$_SESSION [C('USER_AUTH_KEY')]) {
            //跳转到认证网关
            redirect(PHP_FILE . C('USER_AUTH_GATEWAY'));
        }
    }
    
	public function getRegion(){
		$Region=M("Region");
		$map['pid']=$_REQUEST["pid"];
		$map['type']=$_REQUEST["type"];
		$list=$Region->where($map)->select();
		echo json_encode($list);
	}
	
    //删除图片
    public function foreverdelfile(){
    	$ajaxreturn = 0;
    	$files = I('files');

    	if(is_file($files)){
    		if(unlink($files)){
    			$ajaxreturn = 1;
    		}
    	}
    	$this->ajaxReturn($ajaxreturn);
    }
}
?>
